namespace KinonekoSoftware.CodariaDB.Documents.Composites
{
    partial class CompositeEngine
    {
        public void AddSentence(Sentence evaluation)
        {
            if (evaluation is null)
            {
                return;
            }
            
            SentenceDB.Insert(evaluation);
        }
        
        public void UpdateSentence(Sentence evaluation)
        {
            if (evaluation is null)
            {
                return;
            }
            
            

            SentenceDB.Update(evaluation);
        }
        
        public void RemoveSentence(Sentence evaluation)
        {
            if (evaluation is null)
            {
                return;
            }

            SentenceDB.Delete(evaluation.Id);
        }

        public int SentenceCount => SentenceDB.Count();

        public IEnumerable<Sentence> GetSentences() => SentenceDB.FindAll().ToList();
        
        public IEnumerable<Sentence> GetSentences(string id) => SentenceDB.Find(x => x.From == id);
    }
}